(float_to_string): Skip `-' like digits when ensuring
authorRichard M. Stallman <rms@gnu.org>
Tue, 1 Jun 1993 03:33:40 +0000 (03:33 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 1 Jun 1993 03:33:40 +0000 (03:33 +0000)
result looks like a float.

src/print.c

index 381f43b4693ac6ca646fa59192de630769737ab0..6075ea2221054781271994024db4f0a22a2ca3eb 100644 (file)
@@ -653,7 +653,7 @@ float_to_string (buf, data)
   /* Make sure there is a decimal point with digit after, or an exponent,
      so that the value is readable as a float.  */
   for (cp = buf; *cp; cp++)
-    if (*cp < '0' || *cp > '9')
+    if ((*cp < '0' || *cp > '9') && *cp != '-')
       break;
 
   if (*cp == '.' && cp[1] == 0)